home *** CD-ROM | disk | FTP | other *** search
/ CD Fun House 8 / CD Funhouse Version 8.0 - Wayzata Technology (7013) (1993).iso / pc / pc / cards / bidding / bidding.h < prev    next >
C/C++ Source or Header  |  1989-02-14  |  2KB  |  88 lines

  1. /* bidding.h */
  2. /*
  3.             Bridge Bidder    Version 2.0
  4.             by Nathan Glasser
  5.             nathan@brokaw.lcs.mit.edu (internet)
  6.             nathan@mit-eddie.uucp (usenet)
  7.  
  8.             February, 1989
  9. ------------------------------------------------------------------------------
  10. Copyright 1988, 1989 by Nathan Glasser.
  11. You may feel free to distribute this program in its current form.
  12. Please do not remove this copyright information.
  13. */
  14.  
  15. #include <stdio.h>
  16. #include <ctype.h>
  17. #ifdef MSDOS
  18. #include <string.h>
  19. #include <stdlib.h>
  20. #define random rand
  21. #define srandom srand
  22. #define index strchr
  23. #else
  24. #include <strings.h>
  25. #endif
  26.  
  27. #define LOGFILE "bidding.log"
  28.  
  29. #define JACK 11
  30. #define QUEEN 12
  31. #define KING 13
  32. #define ACE 14
  33.  
  34. #define SPADES 0
  35. #define HEARTS 1
  36. #define DIAMONDS 2
  37. #define CLUBS 3
  38.  
  39. #define NOTRUMP 4
  40. #define RANK_USED 4
  41.  
  42. #define DOUBLE 5
  43. #define REDOUBLE 6
  44. #define PASS 7
  45.  
  46.  
  47. #define FIRSTPAIR 0
  48. #define SECONDPAIR 1
  49. #define RELATIVE 1
  50. #define NEITHER 2
  51. #define BOTH 3
  52.  
  53.  
  54. struct card_or_bid {
  55.     int rank;
  56.     int suit;
  57. };
  58.  
  59. typedef struct card_or_bid card;
  60.  
  61. typedef struct bid {
  62.     struct card_or_bid bid;
  63.     struct bid *next,*prev;
  64. } bid;
  65.  
  66. typedef card hand[13];
  67.  
  68. typedef struct deal {
  69.     hand hands[4];
  70.     int vulnerability;
  71.     bid *bids;
  72.     int num_bids;
  73.     int bidding_done;
  74.     card opening_lead;
  75. } deal;
  76.  
  77.  
  78.  
  79. /* Individual users may want to modify these values for their system. */
  80.  
  81. /* Default number of bridge hands (boards) to deal. */
  82. #define DEF_NUM_HANDS 10
  83.  
  84. /* If you wish to use formfeeds to clear the screen instead of repeated
  85.    newlines, comment out the definition of SCREEN_CLEAR_SIZE. Otherwise
  86.    this value indicates the number of newlines to use for this purpose. */
  87. #define SCREEN_CLEAR_SIZE 24
  88.